package java67_adv7;

import java.io.*;

public class CopyFile {

	public static void main(String[] args) throws IOException {
		// Scanner in = new Scanner(System.in);
		// System.out.println("输入要复制的文件:");
		String a = args[0];// in.next();
		// System.out.println("输入复制到的目标文件:");
		String b = args[1];// in.next();
		File from = new File(a);// !!!!!!!!!!!
		// f:\mypic\1.jpg
		InputStream ab = new FileInputStream(a);// /
		OutputStream bc = new FileOutputStream(b + File.pathSeparator + from.getName());
		byte[] w = new byte[ab.available()];
		int s = ab.read(w);
		bc.write(w, 0, s);// 将ab的字节全部写入bc中
		ab.close();
		bc.close();

	}

}
